import request from '@/utils/request'

/**
 * 获取-权限点列表
 * @returns
 */
export const getPermListAPI = () => {
  return request({
    method: 'get',
    url: '/sys/permission'
  })
}

/**
 * 新增权限
 * @param {*} permForm
 * @returns
 */
export const addPermAPI = permForm => {
  return request({
    method: 'post',
    url: '/sys/permission',
    data: permForm
  })
}
/**
 * 获取权限点详情
 * @param {*} id 权限id
 * @returns Promist
 */
export const getPermDetailAPI = id => {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`
  })
}

/**
 * 编辑/修改权限
 * @param {*} permForm
 * @returns
 */
export const editPermAPI = permForm => {
  return request({
    method: 'put',
    url: `/sys/permission/${permForm.id}`,
    data: permForm
  })
}
/**
 * 删除权限点
 * @param {*} id 删除的权限id
 * @returns
 */
export const delPermAPI = id => {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`
  })
}
